package com.punch.order.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.service.IService;
import com.punch.common.dto.order.OrderDTO;
import com.punch.common.page.PageInfo;
import com.punch.common.query.order.OrderAPPQueryInfo;
import com.punch.common.vo.order.OrderAppDetailVO;
import com.punch.common.vo.order.OrderAppPageVO;
import com.punch.order.model.CommonOrder;

/**
 * <p>
 * 通用订单 服务类
 * </p>
 *
 * @author wjj
 * @since 2020-12-09
 */
public interface CommonOrderService extends IService<CommonOrder> {

    /**
     * 创建订单
     *
     * @param orderDTO 创建订单
     * @return json
     */
    JSONObject createOrder(OrderDTO orderDTO);

    /**
     * 修改订单状态
     *
     * @param orderSN 编码
     * @param status  状态
     */
    void updateOrderStatus(String orderSN, int status);

    /**
     * 修改订单状态
     *
     * @param orderId 订单id
     * @param status  状态
     */
    void updateOrderStatus(Long orderId, int status);


    /**
     * APP端查询订单
     *
     * @param queryInfo 查询条件
     * @return PageInfo<OrderAppPageVO>
     */
    PageInfo<OrderAppPageVO> listOrder(OrderAPPQueryInfo queryInfo);

    /**
     * 获取订单先去
     *
     * @param orderId 订单id
     * @return OrderAppDetailVO
     */
    OrderAppDetailVO getOrder(Long orderId);

    /**
     * 支付完成
     *
     * @param orderId 订单id
     */
    void finishPayOrder(Long orderId);

    /**
     * 开班修改订单状态
     *
     * @param classId 课程班级id
     * @return boolean
     */
    Boolean startClass(Long classId);
}
